             package com.java.diagnostics.visualizer.recommender.sovereign;
             
             import com.java.diagnostics.visualizer.data.AggregateData;
             import com.java.diagnostics.visualizer.data.DataPoint;
             import com.java.diagnostics.visualizer.data.TupleData;
             import com.java.diagnostics.visualizer.recommender.Recommendation;
             import com.java.diagnostics.visualizer.recommender.RecommendationBase;
             import com.java.diagnostics.visualizer.recommender.util.Messages;
             import java.text.MessageFormat;
             
             public class AddActionCodeSummary
               extends RecommendationBase
               implements Recommendation
             {
               public void recommend(AggregateData data)
               {
                 String[] explanations = { Messages.getString("action.0.explanation"), 
                   Messages.getString("action.1.explanation"), 
                   Messages.getString("action.2.explanation"), 
                   Messages.getString("action.3.explanation"), 
                   Messages.getString("action.4.explanation"), 
                   Messages.getString("action.5.explanation"), 
                   Messages.getString("action.6.explanation") };
                 
                 TupleData pauses = data.getTupleData("VGCLabels.action");
                 
                 if (pauses != null) {
                   DataPoint[] dataPoints = pauses.getDataPoints();
                   if (dataPoints.length > 0) {
                     int[] counts = new int[7];
                     for (int i = 0; i < dataPoints.length; i++) {
                       int action = (int)dataPoints[i].getRawY();
                       counts[action] += 1;
                     }
                     
                     for (int i = 0; i < 7; i++) {
                       addToActionCounts(data, "actions" + i, counts[i]);
                     }
                     
                     for (int i = 0; i < counts.length; i++) {
                       if (counts[i] > 0) {
                         String key = explanations[i];
                         String count = MessageFormat.format(
                           Messages.getString("action.occurrences"), 
                           new Integer[] { Integer.valueOf(counts[i]) });
                         addToActionSummary(data, key, count);
                       }
                     }
                   }
                 }
               }
             }


